/*
 * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
 *
 * https://www.mall4j.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */
package com.tps.cloud.exception;

public class BusinessException extends RuntimeException {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    /**
     * 异常Code
     */
    private String code;

    /**
     * 构建新异常
     *
     * @param message
     */
    public BusinessException(String message) {
        super(message);
    }

    /**
     * 根据case构建新异常
     *
     * @param message
     * @param e
     */
    public BusinessException(String message, Throwable e) {
        super(message, e);
    }

    /**
     * 构建新异常
     *
     * @param message
     */
    public BusinessException(String code,String message) {
        super(message);
        this.code = code;
    }

    /**
     * 根据case构建新异常
     *
     * @param message
     * @param e
     */
    public BusinessException(String code,String message, Throwable e) {
        super(message, e);
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

}
